<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" CONTENT="no-cache">
    <meta http-equiv="Pragma" CONTENT="no-cache">
    <meta content="telephone=no" name="format-detection" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <title>金穗服务</title>
<script type="text/javascript" src="../script/constants.js"></script>
<script type="text/javascript" src="../script/tmd5.js"></script>
<script type="text/javascript" src="../script/aes.js"></script>
<script type="text/javascript" src="../script/modeecb.js"></script>
<script type="text/javascript" src="../script/naes.js"></script>
<script type="text/javascript" src="../script/api.js"></script>
<style type="text/css">
        body {
            text-align: center;
            background-color: #305066;
        }
        .title {
            margin-top: 20%;
            color: #22C3B1;
        }
    </style>
     <script type="text/javascript">
 
	function goBack(){
	    var phone = $api.getStorage("dl_phone");
        var callback = function(ret, err){
            //console.log(JSON.stringify(ret));
            var flag = ret.flag;
        }
        var parameter = {"phone":phone};
        apiAjax(JSON.stringify(parameter),url.zxurl,callback);
		$api.rmStorage("loginid");
		$api.rmStorage("dl_phone");
		$api.rmStorage("de_num");
 		$api.rmStorage("openid");
 		$api.rmStorage("LOGIN_FLAG");
 		$api.rmStorage("payPwd");
 		localStorage.setItem("ShoppingCart","");
	    $api.setStorage("shsk","N");
	    if($api.getStorage("chartPwd") == "true" || $api.getStorage("chartPwd") == true){
	       $api.setStorage("chartPwd","EXIT");
	    }
		$api.setStorage("lgtime","");
	    api.sendEvent({
	     name:'reloadIndex'
		});
        api.closeToWin({
	      name: 'root'
        });
	}
	</script>
    </head>
<body>
<header>
<div onclick="goBack();">
<div style="float:left;">
<img style="width:40%" src="../image/navbtn_back.png" />
</div>
<div style="float:left;color: #fff;">返回
</div>
</div>
</header>
<script type="text/javascript" src="../script/deblock.js"></script>
<script type="text/javascript">
  var pwd = $api.getStorage($api.getStorage('dl_phone')+'CHART');   
	new H5lock({
	    chooseType: 3,
	    pwd: pwd
	}).init();
  apiready = function(){
    $api.fixStatusBar( $api.dom('header') );
    api.addEventListener({
	    name: 'closeLock'
	}, function(ret, err) {
	   setTimeout(function(){
	     api.closeWin();
	   },1000);
	});
	
    api.addEventListener({
	    name: 'debLock'
	}, function(ret, err) {
	    if(ret.value.key){
            var lgtime = new Date().getTime();
            $api.setStorage("lgtime",lgtime);
            $api.setStorage("LOGIN_FLAG","Y");
			api.sendEvent({
                name:'reloadIndex'
            });
            api.closeWin();
	    }else{
	      if(parseInt($api.getStorage("chartWrong")) == 5){
	        api.alert({msg:"错误次数过多，请使用用户名密码登录"});
	        api.openWin({
	            name: 'login',
	            url: 'login.html'
            });
	      }
	    }
	});
  }
</script>
</body>
</html>
